﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace _2_附加属性
{
    class School
    {
        public static int GetGrad(DependencyObject obj)
        {
            return (int)obj.GetValue(GradProperty);
        }

        public static void SetGrad(DependencyObject obj, int value)
        {
            obj.SetValue(GradProperty, value);
        }

        public static readonly DependencyProperty GradProperty =
            DependencyProperty.RegisterAttached("Grad", typeof(int), typeof(School), new PropertyMetadata(0));
    }
}
